package com.ren.tools;


import java.io.BufferedReader;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.UnsupportedEncodingException;

public class InputStreamUtils {
	
	public static BufferedReader inputStream2bufferedReader(InputStream inStream,String charSet){
		
		try {
			if (charSet==null) {
				return new BufferedReader(new InputStreamReader(inStream));
			} else {
				return new BufferedReader(new InputStreamReader(inStream,charSet));
			}
		} catch (UnsupportedEncodingException e) {
			throw new RuntimeException(e);
		}
	}
}
